<?php
/**
 * Copyright 2013 Marek Kaszewski
 *
 * This file is part of the JHUB1 Online Community Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

return array(
    'controllers' => array(
        'invokables' => array(
            'Jhub1_Console\Controller\Index' => 'Jhub1_Console\Controller\IndexController',
            'Jhub1_Console\Controller\Users' => 'Jhub1_Console\Controller\UsersController',
            'Jhub1_Console\Controller\Agents' => 'Jhub1_Console\Controller\AgentsController'
        ),
    ),
    'console' => array(
        'router' => array(
            'routes' => array(
                'agents' => array(
                    'options' => array(
                        'route' => 'agent [--verbose|-v] [--result|-r] (create|addresses|status):operation [--name=] [--descr=] [--owner=] [--id=]',
                        'defaults' => array(
                            '__NAMESPACE__' => 'Jhub1_Console\Controller',
                            'controller' => 'Agents',
                            'action' => 'create'
                        ),
                    ),
                ),
                'values' => array(
                    'options' => array(
                        'route' => 'value [--verbose|-v] (insert|list|status):operation [--agentId=] [--name=] [--value=] [--address=]',
                        'defaults' => array(
                            '__NAMESPACE__' => 'Jhub1_Console\Controller',
                            'controller' => 'Agents',
                            'action' => 'values'
                        ),
                    ),
                ),
                'endpoints' => array(
                    'options' => array(
                        'route' => 'endpoint [--verbose|-v] (insert|list-types|list-values):operation [--owner=] [--name=] [--descr=] [--class=]',
                        'defaults' => array(
                            '__NAMESPACE__' => 'Jhub1_Console\Controller',
                            'controller' => 'Agents',
                            'action' => 'endpoints'
                        ),
                    ),
                ),
                'users' => array(
                    'options' => array(
                        'route' => 'user [--verbose|-v] (create|status|activate|deactivate|delete):operation <userEmail> [<password>] [--name=] [--surname=]',
                        'defaults' => array(
                            '__NAMESPACE__' => 'Jhub1_Console\Controller',
                            'controller' => 'Users',
                            'action' => 'create'
                        ),
                    ),
                ),
                'uuid' => array(
                    'options' => array(
                        'route' => 'uuid [--verbose|-v] (checksum|validate|info):operation <uuid>',
                        'defaults' => array(
                            '__NAMESPACE__' => 'Jhub1_Console\Controller',
                            'controller' => 'Index',
                            'action' => 'uuid'
                        ),
                    ),
                ),
                'dbXperations' => array(
                    'options' => array(
                        // add [ and ] if optional ( ex : [<doname>] )getd happen
                        'route' => 'dbx opx [--verbose|-v] <doname>',
                        'defaults' => array(
                            '__NAMESPACE__' => 'Jhub1_Console\Controller',
                            'controller' => 'index',
                            'action' => 'dboperations'
                        ),
                    ),
                ),
                'dboperations' => array(
                    'options' => array(
                        'route' => 'dba op [--verbose|-v] (init|drop):operation',
                        'defaults' => array(
                            '__NAMESPACE__' => 'Jhub1_Console\Controller',
                            'controller' => 'index',
                            'action' => 'dboperations'
                        ),
                    ),
                ),
/*                'db-actions' => array(
                    'options' => array(
                        'route' => 'dba operation [--verbose|-v] <action>',
                        'defaults' => array(
                            '__NAMESPACE__' => 'Tools\Controller',
                            'controller' => 'index',
                            'action' => 'dboperations'
                        )
                    )
                )*/
            )
        ),
    ),
    //(init|drop):action
    'service_manager' => array(
        'factories' => array(
            'translator' => 'Zend\I18n\Translator\TranslatorServiceFactory',
        ),
    ),
    'view_manager' => array(
        'display_not_found_reason' => true,
        'display_exceptions' => true,
        'template_path_stack' => array(
            __DIR__ . '/../view',
        ),
    ),
   'doctrine' => array(
        'driver' => array(
            'Jhub1_app_driver' => array(
                'class' => 'Doctrine\ORM\Mapping\Driver\AnnotationDriver',
                'cache' => 'array',
                'paths' => array(__DIR__ . '/../../Jhub1_Common/src/Jhub1_Common/Entity')
            ),
            'orm_default' => array(
                'drivers' => array(
                    'Jhub1_Common\Entity' => 'Jhub1_app_driver'
                )
            )
        )
    )
);
